'use strict';

module.exports = {
  up: async(queryInterface, Sequelize) => {
      const { DECIMAL, DATE  ,INTEGER} = Sequelize;

      await queryInterface.createTable('t_spread', {
          id: { type: INTEGER, primaryKey: true, autoIncrement: true },
          user_id:{type:DECIMAL(20),'allowNull': false},
          ad_id:{type:DECIMAL(20),'allowNull': false},
          createtime:{type:DATE,'allowNull': false},
          modifytime:{type:DATE,'allowNull': false},
          state:{type:DECIMAL(1),'allowNull': false},
          earn:{type:DECIMAL(20),'allowNull': false},
      },{
          timestamps: false,  //去除createAt updateAt
          freezeTableName: true,  //使用自定义表名
      });
  },

  down: async queryInterface => {
      await queryInterface.dropTable('t_spread');
  }
};
